<?php header('Content-Type: text/html; charset=UTF-8');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
error_reporting(0);

$regex = array('title' => '0', 'content' => './/div[@class="content"]');

$docDetail = new DOMDocument('1.0', 'UTF-8');
$docDetail->encoding = 'UTF-8';
$docDetail->loadHTMLFile('http://m.baomoi.com/Home/AmNhac/kenh14.vn/Giong-ca-17-tuoi-cua-The-Voice-khien-cu-dan-mang-dien-dao/8848877.epi');
$xpathDetail = new DOMXPath($docDetail);
$content = array();
forEach ($regex as $key => $value) {
    if ($key == "title") {
        $content[] = $value;
    } else {
        $queryDetail = $value;
        $resDetail = $xpathDetail->query($queryDetail);
        if ($resDetail) {
            $res = $docDetail->saveHTML($resDetail->item(0));
            
			echo utf8_decode($res);
			
			die;
        }
    }
}

?>
